<?php


namespace app\model;

use think\Model;

class User extends Model
{
    public function departments()
    {
        return $this->belongsToMany(
            Department::class,
            DepartmentUser::class,
            'id',
            'user_id'
        );
    }

    public function roles()
    {
        return $this->belongsToMany(
            AuthGroup::class,
            AuthGroupAccess::class,
            'id',
            'uid'
        );
    }
}